﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ConsoleTestPhoneCommands.ProxyPhone;

namespace ConsoleTestPhoneCommands
{
    class Program
    {
        static void Main(string[] args)
        {
            var proxy = new ProxyPhone.PhoneServiceClient();
            var devices = proxy.ConnectableDevice();

            var currentConnectableDevice =
                devices.Value.FirstOrDefault(d => d.IsEmulator);

            var name = currentConnectableDevice.Name;
            proxy.SelectConnectableDevice(name);
            proxy.Connect();
            proxy.SystemInfo();

            Console.WriteLine("press next");
            Console.ReadKey();

            currentConnectableDevice =
                devices.Value.FirstOrDefault(d => d.IsEmulator && d.Name != name);

            proxy.SelectConnectableDevice(currentConnectableDevice.Name);
            proxy.Connect();
            proxy.SystemInfo();

            Console.WriteLine("press to end");
            Console.ReadKey();
        }
    }
}
